package android.slc.module.project.repository.local;


import android.slc.box.db.sp.DbCd;

public class ProjectConfig {
    private static class Holder {
        private static final ProjectConfig INSTANCE = new ProjectConfig();
    }

    public static ProjectConfig getInstance() {
        return Holder.INSTANCE;
    }

    private final DbCd db;

    protected ProjectConfig() {
        db = new DbCd("project_config");
        db.putIfAbsent("openMock", false, false)
                .putIfAbsent("mockPeriod", 4000, false)
                .putIfAbsent("autoRestart", true, false)
                .putIfAbsent("forcedDebug", false, false)
                .putIfAbsent("goToHomeMinute", 30);
    }

    public boolean isOpenMock() {
        return db.getBoolean("openMock", false, true);
    }

    public int getMockPeriod() {
        return db.getInt("mockPeriod", 4000, true);
    }

    public boolean isAutoRestart() {
        return db.getBoolean("autoRestart", true, true);
    }

    public boolean isForcedDebug() {
        return db.getBoolean("forcedDebug", false, true);
    }

    public int getGoT0HomeMinute() {
        return db.getInt("goToHomeMinute", 30, true);
    }

}
